package com.xj.edu.hotel.service.serviceImpl;

import com.xj.edu.hotel.mapper.CollectMapper;
import com.xj.edu.hotel.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xj.edu.hotel.domain.Collect;

import java.util.List;

@Service
public class CollectServiceImpl implements CollectService {
    @Autowired
    private CollectMapper collectMapper;
    @Override
    public int collectHotel(Collect collect) {
        return collectMapper.insert(collect);
    }
    @Override
    public List <Collect> findByUserId(String id){
        return collectMapper.findByUserId(id);
    }

    @Override
    public int removeCollect(String id) {
        return collectMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Collect findByHotelId(String id) {
        return collectMapper.findByHotelId(id);
    }

}
